const express = require('express');
const foodItem = require('../../app/controllers/foodItem.server.controller.js');

module.exports = (app) => {
    const router = express.Router();

    router.route('/getFoodItemByName/:name')
    .get(foodItem.getFoodItemByName);

    router.route('/getFoodItems')
    .get(foodItem.getFoodItems);

    router.route('/getFoodItemByProducer')
    .post(foodItem.getFoodItemByProducer);
    
    router.route('/addFoodItem')
    .post(foodItem.addFoodItem);
    
    router.route('/getFoodItemByNameAndProducer')
    .post(foodItem.getFoodItemByNameAndProducer);

    router.route('/deleteFooditemByItemId/:itemId')
    .delete(foodItem.deleteFoodByItemId);

    app.use('/foodStore', router);
};